<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * SitePaperAuthor.
 *
 * @license [http://www.85do.com] [杭州永奥网络科技有限公司]
 * @copyright Copyright (c) 2018-2026 Hangzhou Yongao Technology Co., Ltd. All rights reserved.
 */
class SitePaperAuthor extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('site_paper_author', function (Blueprint $table) {
            //$table->bigIncrements('id');//BigID unsigned
            $table->unsignedBigInteger('paper_id');//论文ID
            $table->string('email', 255);//email（唯一）
            $table->string('title', 8)->default('');// 头衔，如Dr. Mr.
            $table->string('first_name', 32)->default('');// 名字
            $table->string('middle_name', 32)->default('');// 中名
            $table->string('last_name', 32)->default('');// 姓氏
            $table->string('country', 12)->default('');// 所在国家
            $table->boolean('presenting_author')->default(0);// 呈现作者
            $table->boolean('corresponding_author')->default(0);// 对应作者

            // 注意时间戳位数
            $table->timestamps();
            $table->softDeletes();

            // index
            $table->index('paper_id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('site_paper_author');
    }
}